import $http from '@/utils/request'

// 工单搜索
export function ticketSearchAPI(params) {
  return $http({
    url: '/api/task-service/task/search',
    method: 'GET',
    params
  })
}
// 工单详情
export const ticketDetails = (taskId) => {
  return $http({
    url: `/api/task-service/task/taskInfo/${taskId}`
  })
}
// 根据售货机获取运营人员列表
export const listOfPeopleAPI = (num) => {
  return $http({
    url: `/api/user-service/user/operatorList/${num}`
  })
}
// 补货清单渠道详情
export const replenishmentListAPI = (innerCode) => {
  return $http({
    url: `/api/vm-service/channel/channelList/${innerCode}`
  })
}
// 创建工单
export const CreateATicketAPI = (data) => {
  return $http({
    url: '/api/task-service/task/create',
    method: 'POST',
    data
  })
}
// 补货详情
export const replenishmentDetailsAPI = (id) => {
  return $http({
    url: `/api/task-service/taskDetails/${id}`
  })
}
// 取消工单
export const cancelATicketAPI = ({ desc, taskId }) => {
  return $http({
    url: `/api/task-service/task/cancel/${taskId}`,
    method: 'POST',
    data: {
      desc,
      taskId
    }
  })
}

